package com.wanglin.reggie.common;

/**
 * BaseContext
 *
 * @author 王林
 * @version 1.0
 * @description
 * @date 2025/5/29 02:05
 * @projectName reggie_take_out
 * @package com.wanglin.reggie.common
 * @className com.wanglin.reggie.common.BaseContext
 * @copyright Copyright 2020 Theofanis, Wang Lin All rights reserved.
 */
public class BaseContext {
    // 定义一个ThreadLocal变量，用于存储当前线程的id
    private static ThreadLocal<Long> threadLocal = new ThreadLocal<>();
    // 设置当前线程的id
    public static void setCurrentId(Long id){
        threadLocal.set(id);
    }
    // 获取当前线程的id
    public static Long getCurrentId() {
        return threadLocal.get();
    }
}
